/*
 * BetaModelThermistor.hpp
 *
 * Copyright 2012 Pieter Agten
 *
 * This file is part of tltgen.
 *
 * tltgen is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * tltgen is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with tltgen.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @file   BetaModelThermistor.hpp
 * @author Pieter Agten (pieter.agten@gmail.com)
 * @date   3 apr 2012
 */

#ifndef BETAMODELTHERMISTOR_HPP
#define BETAMODELTHERMISTOR_HPP

#include "Thermistor.hpp"
#include "Resistance.hpp"
#include "Temperature.hpp"

namespace tltgen {

  class BetaModelThermistor : public Thermistor {
  public:
    BetaModelThermistor(Temperature t0, Resistance r0, double beta);
    virtual ~BetaModelThermistor();

    static bool isValidT0(Temperature t0);
    virtual Temperature getT0() const;

    static bool isValidR0(Resistance r0);
    virtual Resistance getR0() const;

    static bool isValidBeta(double beta);
    virtual double getBeta() const;

    virtual bool isValidParameterIndex(unsigned int pi) const;
    virtual double getParameterValue(unsigned int pi) const;

    virtual bool isValidResistance(Resistance resistance) const;
    virtual Temperature getTemperature(Resistance resistance) const;

    virtual bool isValidTemperature(Temperature temperature) const;
    virtual Resistance getResistance(Temperature temperature) const;

    virtual void accept(ThermistorVisitor* visitor) const;

    virtual std::ostream &print(std::ostream &stream) const;

  private:
    const Temperature t0;
    const Resistance r0;
    const double beta;
  };

}

#endif
